<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.ArrayList"%>
<%@page import="model.bean.TourInfo"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
#main{
float:left;
margin-left:100px;
overflow: hidden;
width:400px;
height: auto;
border: 1px solid #AC8853;
border-radius:5px;
}
.bag {
overflow: hidden;
height:auto;
}
#main *{
border-radius:5px;
border-color: #AC8853;
font-style: oblique;
font-family: Serif;
}
#main .lb {
width: 150px;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
}
#main .ip {
width: 220px;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
}
.tableTour {
width: auto;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
border-radius: 5px;
border: 2px solid #AC8853;
}
</style>
<title>Tour Manager Panel</title>
</head>
<body>
<jsp:include page="common/header.jsp"></jsp:include>
<div id="page-wrapper">
<form name = "tourForm" method = "post" action = "${pageContext.request.contextPath}/TourUpdateServlet">
<div class="panel panel-default" style="width: 80%; margin: 0 auto;">
			<div class="panel-heading">Edit Tour</div>
			<div class="panel-body">
			<div id = "main">
			<div class = "bag"><label class = "lb"> Ngày Khởi Hành: </label><input class = "ip" type = "text" name = "tfDayComing"></div>
			<div class = "bag"><label class = "lb"> Ngày Kết Thúc: </label><input class = "ip" type = "text" name = "tfDayEnding"></div>
			<div class = "bag"><input class = "ip" id = "btCheck" type = "submit" name = "process" value = "Check Tour Info" /></div>
			</div>
 			<% 
                       String editImg = request.getContextPath()+"/manage_tour/images/user_edit.png";
 					   String delImg = request.getContextPath()+"/manage_tour/images/trash.png";
                       ArrayList<TourInfo> listTour = (ArrayList<TourInfo>)
                                            request.getAttribute("listTour");
                       if (listTour!= null) {
                          			 %>
                           <table border="1px" class = "tableTour" >
                               <tr><th>Ma tour mau</th>
                                   <th>Ma tour</th>
                                   <th>Ten tour</th>
                                   <th>Ngay bat dau</th>
                                   <th>Ngay ket thuc</th>
                                   <th></th>
                                   <th></th>
                                </tr>
                          			 <%
                           for (int i = 0; i < listTour.size(); i++ ) {
                       
                       
                 			 %>
                    <tr><td><%=listTour.get(i).getTempTourId()%></td>
                        <td><%=listTour.get(i).getTourId()%></td>
                        <td><%=listTour.get(i).getTourName()%></td>
                        <td><%=listTour.get(i).getDayStart()%></td>
                        <td><%=listTour.get(i).getDayEnd()%></td>
                        <td><a href = "${pageContext.request.contextPath}/TourUpdateServlet?index=<%=listTour.get(i).getTourId()%>
                                       &process=updateTour"><label class = "edit"><image width = "20px" height = "15px" src = "<%=editImg %>"></label></a></td>
                        <td><a href = "${pageContext.request.contextPath}/TourUpdateServlet?index=<%=listTour.get(i).getTourId()%>
                                       &process=delete"><label class = "edit"><image width = "20px" height = "15px" src = "<%=delImg %>"></label></a></td>
                    </tr>
                    <% } 
                           %>
                           </table>
                           <%
                           }
                           %>
</div>
</div>
</form>
</div>
<jsp:include page="common/footer.jsp"></jsp:include>
</body>
</html>